package com.edfu.commons.email.dao;

import java.util.List;

import com.edfu.commons.email.vo.Event;
import com.edfu.commons.email.exceptions.EventExistsException;
import com.edfu.commons.email.exceptions.EventNotFoundException;
import com.edfu.commons.email.exceptions.TemplateNotFoundException;

/**
 * @author naresred
 *
 */
public interface IEmailEventDAO {
	
	/**
	 * Populates all events to db. This is one time activity and should not occur every time.
	 * 
	 * @param events
	 */
	public void populateEvents(List<Event> events);	
	
	/**
	 * Creates an event. But in real time there is no need to create an event unless there is support for dynamic event creation.
	 * This method throws @EventExistsException if event name already exists in the system
	 * 
	 * @param eventName
	 * @param description
	 * @param isActive
	 * @throws EventExistsException
	 */
	public void createEvent(String eventName, String description, boolean isActive) throws EventExistsException;
	
	/**
	 * Deactivates an event. All templates associated to this event will be deactivated.
	 * This method throws @EventNotFoundException if the event is not found in the system 
	 * 
	 * @param eventName
	 * @throws EventNotFoundException
	 * @throws TemplateNotFoundException 
	 */
	public void deactivateEvent(String eventName) throws EventNotFoundException, TemplateNotFoundException;
	
	/**
	 * Activates an event. All templates associated to this event will be activated.
	 * This method throws @EventNotFoundException if the event is not found in the system 
	 * 
	 * @param eventName
	 * @throws EventNotFoundException
	 * @throws TemplateNotFoundException 
	 */
	public void activateEvent(String eventName) throws EventNotFoundException, TemplateNotFoundException;
	
	/**
	 * Retrieves all active events.
	 * 
	 * @return List<Event>
	 */
	public List<Event> getActiveEvents();
	
	/**
	 * Retrieves all events. Even deactivated even will also be fetched.
	 * 
	 * @return List<Event>
	 */
	public List<Event> getAllEvents();
	
	/**
	 * Retrieves an event.This method throws @EventNotFoundException if the event is not found in the system
	 * 
	 * @param eventName
	 * @return Event
	 * @throws EventNotFoundException
	 */
	public Event getEvent(String eventName) throws EventNotFoundException;	

}
